import { lazy } from 'react'

/**
 * @description 路由配置
 * @prop {boolean?} [auth=true] 是否需要登录
 */
const routes = [
  {
    path: '/',
    exact: true,
    component: lazy(() => import('@/pages/Home')),
  },
  {
    path: '/login',
    component: lazy(() => import('@/pages/Login')),
    auth: false,
    title: '用户登录',
  },
  {
    path: '/sign-up',
    component: lazy(() => import('@/pages/SignUp')),
    auth: false,
    title: '用户注册',
  },
  {
    path: '/account',
    component: lazy(() => import('@/pages/Account')),
    title: '用户中心',
  },

  {
    path: '/project-edit/:id',
    component: lazy(() => import('@/pages/ProjectEdit')),
    title: '项目编辑',
  },
  {
    path: '/project/:id',
    component: lazy(() => import('@/pages/Project')),
    title: '项目详情',
  },

  {
    path: '/test',
    component: lazy(() => import('@/pages/TestPage')),
    auth: false,
  },
]

export default routes
